package com.jic.market.controller.rest;

import com.jic.common.base.vo.RestResult;
import com.jic.market.api.rest.RealTimePriceRestApi;
import com.jic.market.request.rest.realtimeprice.RealTimePriceRequest;
import com.jic.market.response.rest.realtimeprice.RealTimePriceListResponse;
import com.jic.market.service.rest.realtimeprice.RealTimePriceRestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * description: RealTimePriceRestController
 * date: 2020/4/10 10:22
 * author: wangys
 * version: 1.0
 */
@RestController
@RequestMapping("/rest/realTimePrice")
@Api(tags = {"获取商品实时价格"})
@Slf4j
public class RealTimePriceRestController implements RealTimePriceRestApi {

    @Autowired
    RealTimePriceRestService realTimePriceRestService;

    @ApiOperation("获取价格库存清单")
    @Override
    public RestResult<RealTimePriceListResponse> getPriceStockList(RealTimePriceRequest request) {
        return RestResult.success(realTimePriceRestService.getPriceStockList(request));
    }
}
